<template>
	<view class="container bg-f9f9f9 pd-28">
		<!-- <u-navbar leftIconSize="40" placeholder titleStyle="font-size:36rpx;font-weight:600;" title="提现" bgColor="#ffffff" :autoBack="true"></u-navbar> -->
		<view class="bg-white radio-20 pdx-20">
			<view class="h-92 border-bottom text-32 flex ai_center">
				提现信息
			</view>
			<view class="h-92 border-bottom text-28 flex ai_center jc_center">
				<view class="text-666 ">银行账号</view>
				<input class="flex1 text-right text-28" v-model="info.bank_no" placeholder="请输入"></input>
			</view>
			<view class="h-92 border-bottom text-28 flex ai_center jc_center">
				<view class="text-666 ">开户行名称</view>
				<input class="flex1 text-right text-28" v-model="info.bank_open" placeholder="请输入"></input>
			</view>
			<view class="h-92 border-bottom text-28 flex ai_center jc_center">
				<view class="text-666 ">银行名称</view>
				<input class="flex1 text-right text-28" v-model="info.bank_name" placeholder="请输入"></input>
			</view>
			<view class="h-92 border-bottom text-28 flex ai_center jc_center">
				<view class="text-666 ">真实名称</view>
				<input class="flex1 text-right text-28" v-model="info.realname" placeholder="请输入"></input>
			</view>
			<view class="h-92 text-28 flex ai_center jc_center">
				<view class="text-666 ">联系电话</view>
				<input class="flex1 text-right text-28" v-model="info.mobile" placeholder="请输入"></input>
			</view>
		</view>
		<view class="bg-white radio-20 pdx-20 pdb-28 mgt-28">
			<view class="h-92 border-bottom text-32 flex ai_center">
				提现金额
			</view>
			<view class="mgt-24 border h-92 radio-12 flex ai_center pdx-18">
				￥ <input class="text-28" v-model="money" type="digit" placeholder="请输入提现金额"></input>
			</view>
			<view class="mgt-24 text-24 line-40 text-999">
				<text>可提现金额 0.00 元，全部提现\n提示:最低提现金额1元</text>
			</view>
			<view class="btn mgt-28" @click="withdraw">提现</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info:{},
				money:''
			}
		},
		onLoad() {
			this.getInfo()
		},
		methods: {
			getInfo(){
				this.get('workflow/withdraw_info').then(res=>{
					this.info = res.data.info
				})
			},
			withdraw(){
				if(!this.info.bank_name){
					uni.showToast({
						title:'请输入银行名称',
						icon:'none'
					})
					return false
				}
				if(!this.info.bank_no){
					uni.showToast({
						title:'请输入银行账号',
						icon:'none'
					})
					return false
				}
				if(!this.info.bank_open){
					uni.showToast({
						title:'请输入开户行名称',
						icon:'none'
					})
					return false
				}
				if(!this.info.mobile){
					uni.showToast({
						title:'请输入联系电话',
						icon:'none'
					})
					return false
				}
				if(!this.info.realname){
					uni.showToast({
						title:'请输入真实名称',
						icon:'none'
					})
					return false
				}
				this.post('workflow/withdraw',{
					...this.info,
					money:this.money
				}).then(res=>{
					uni.showToast({
						title:'提交成功,请耐心等待！',
						success: (res) => {
							setTimeout(()=>{
								uni.navigateBack()
							},1500)
						}
					})
				})
			},
		}
	}
</script>

<style scoped>
.container{
	min-height: 100vh;
}
.bg-f9f9f9{
	background-color: #f9f9f9;
}

.btn{
	height: 88rpx;
	background-image: linear-gradient(270deg,#17FEE9,#94FDC4);
	border-radius: 44rpx;
	line-height: 88rpx;
	text-align: center;
	font-size: 32rpx;
}
</style>
